import de.congrace.exp4j.Calculable;
import de.congrace.exp4j.ExpressionBuilder;
import de.congrace.exp4j.UnknownFunctionException;
import de.congrace.exp4j.UnparsableExpressionException;
import formula.calculator.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class Algebra extends Activity {

        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.algebra_activity);
    }
        
        public void onClick(View v) {
                Intent i = null;
                switch(v.getId()) {
                        case R.id.quadraticFormula:
                                i = new Intent(this, QuadraticFormula.class);
                                break;
                }
                startActivity(i);
        }
        
        private double calculator(String str) {
                Calculable calc = null;
                try {
                        calc = new ExpressionBuilder(str)
                        .build();
                } catch (UnknownFunctionException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (UnparsableExpressionException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                double result = calc.calculate();
                return result;
        }
}